    
EWGL.texture = function(gl,url,functionloaded){
    var tex = gl.createTexture();
    tex.image = new Image();
    tex.image.onload = function() {
        EWGL.texture.handleLoadedTexture(gl,tex);
        !!functionloaded ? functionloaded(tex) : undefined;
    }
    tex.image.src = url;
    return tex;
}
EWGL.texture.handleLoadedTexture = function(gl,texture){
    gl.bindTexture(gl.TEXTURE_2D, texture);
    gl.texImage2D(gl.TEXTURE_2D, 0, texture.image);
    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
    gl.bindTexture(gl.TEXTURE_2D, null);
}